//
//  LWTitleBtn.m
//  1.28  weibo
//
//  Created by mac on 15/1/31.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "LWTitleBtn.h"

@implementation LWTitleBtn

- (id)initWithCoder:(NSCoder *)aDecoder{

    self = [super initWithCoder:aDecoder];
    [self setupBtn];
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame{
 
    self = [super initWithFrame:frame];
    [self setupBtn];
    return self;
}
- (void)setupBtn{

    [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    self.imageView.contentMode = UIViewContentModeCenter;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.titleLabel.x = self.imageView.x;
    self.imageView.x = CGRectGetMaxX(self.titleLabel.frame) + 6;
}
@end
